UI 45579-2: Removes try catch from ILIAS\UI\Implementation\Component\Launcher::getResult method#11208
UI 45579-2: Removes try catch from ILIAS\UI\Implementation\Component\Launcher::getResult method#11208matheuszych wants to merge 1 commit intoILIAS-eLearning:release_10from
Conversation
|
Hello @thibsy, the reason for why i surrounded If you want to get rid of the try-catch, i would propose something like this. First check if a POST Request is available in the Modal. If not, return null, otherwise, return the content of the Modal. The key difference here is, that the request is not added to the Modal if not specifically intended by the user. Alternatively, i can revert the What do you think? Best regards |
thibsy
left a comment
There was a problem hiding this comment.
Hi @matheuszych,
Thx for the follow-up! I agree, it should be the consumers responsibility to provide a valid request and I also think the separation of concerns was an improvement here.
I do however not like the try-catch block because it simply hides any kind of error which might occur during this process. So from my perspective the current proposal is much better. If there is some error beyond having provided a valid request for this operation, it should definitely tell us that.
There is one minor adjustment I would like:
-
instanceof: please compare the current request againstnull. While at it, also replace the ternary return with two separate ones using an if block. This IMO improves readability.
Kind regards,
@thibsy (as UI coordinator)
https://mantis.ilias.de/view.php?id=45579
This is a follow up PR of #10323.
Best regards
@matheuszych